Skip to content

feat(flow): add the record view to the dfd diagram set - #14

Merged
Portll merged 3 commits into
mainfrom
port/dfd-record-view
Nov 23, 2026
Merged

Portll merged 3 commits into
mainfrom
port/dfd-record-view

Conversation

@Portll

@Portll Portll commented Nov 23, 2026

Copy link
Copy Markdown
Owner

What

Adds a sixth view to commitwork dfd: --view record.

  • Every node goes into group lanes or layer lanes, by hop distance from the sources.
  • Each finding sits under the node it is anchored to.
  • Patches replay in a chosen order over a selected subset of change sets.
  • Clicking any element, finding, patch or route opens an inspector. The inspector links back to the related flows, findings and routes.

How it is built

File Role
lib/dfd-record-core.mjs Pure rules: lanes, hop columns, orthogonal routing, patch replay. It imports nothing.
lib/dfd-record-client.js Drawing and interaction. It receives the document and the core as arguments.
lib/dfd-record-render.mjs Writes a single page with default-src 'none'. The style and script are inline, each allowed by its sha256 hash.
lib/dfd-record.css Stylesheet

flow/dfd-cli.mjs:

  • adds record to VIEWS;
  • rejects --collapse and ignores --max for this view, as map, story and replay already do;
  • reports element, finding, patch and lane counts, the outcome rule, and the layout-fault total on stdout.

Schema

dfd@1 gains an optional top-level routes array: open questions, each with the test that would settle it. validateDfd checks its shape and refuses any route whose node is not a node. Documents without routes validate as before.

Tests

  • New tests: lib/test/dfd-record-core, dfd-record-render and dfd-record-client (the client test runs in a stand-in document); flow/test/dfd-record-cli; and four routes cases in lib/test/dfd.test.mjs. The fixtures use invented names only.
  • node --test 'lib/test/*.test.mjs': 5003 tests, 0 fail.
  • node --test 'flow/test/*.test.mjs': 691 tests, 1 fail. The same test fails on clean main (the scanned-repository tests ran in a child carrying --experimental-vm-modules).
  • node bin/comment-schema.mjs: no ratchets beyond those already on main.

commitwork dfd --view record draws every node in group or layer lanes by
hop from the sources, puts each finding under the node it sits on, and
replays patches in a chosen order over a subset of change sets.

The pure rules live in lib/dfd-record-core.mjs, the drawing in
lib/dfd-record-client.js, and lib/dfd-record-render.mjs writes one page
with a hashed CSP. The view takes no --collapse and ignores --max, like
map, story and replay; stdout reports counts and layout faults.

dfd@1 gains an optional top-level routes array (open questions with the
test that would settle them). validateDfd checks its shape and that any
node anchor names a node; documents without routes validate as before.
The escaping and policy assertions used patterns that a browser would not
honour: a lower-case <script> missed <SCRIPT>, and the URL check let any host
that starts with an allowed name through. The page now pins its exact style
and script tags, admits no URL at all, and the escaping check refuses any
image, bold or script tag in any case.
deps-malware-list was merged without its registrations. It now has a light
cost class in monitor/perf-profiles.json, which also gives the scanner
catalogue its tuning entry, and the nested-checkout table records that
bin/malware-list.mjs skips dot-directories.

package.json moved renovate to 44.245.0 alone. The npx pin, the image
tag, monitor/renovate-dryrun.mjs, bin/renovate-run.sh and the threat
model now name the same version.

fixtures/semgrep-workflows/.github/ is declared out of zizmor's scope
beside the other synthetic workflow fixtures.

repoRelative also strips the repository root when a trace path arrives
without its leading slash. findingFileOf removes file:/// whole, and a
--repo --codeql merge left a trace step given as an absolute file URI
unmatched to its module.

docs/EXIT-CODES.md and docs/REFERENCE.md are regenerated.
@Portll
Portll merged commit f3a3175 into main Nov 23, 2026
44 of 45 checks passed
@Portll
Portll deleted the port/dfd-record-view branch November 23, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants